package org.cug.pojo;



import com.fasterxml.jackson.annotation.JsonIgnore;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.Data;


import java.time.LocalDateTime;
@Data
public class User {
    @NotNull//值不能为null
    private Integer id;//主键ID
    @NotEmpty//值不能为null，也不能为空
    @Pattern(regexp = "^[\\u4e00-\\u9fa5a-zA-Z]{2,10}$")
    private String username;
    @JsonIgnore//该属性在被序列化为json字符串的时候将会被忽略
    private String password;//密码
    private String nickname;//昵称
    @NotEmpty
    @Email
    private String email;//邮箱
    private String userPic;//用户头像地址
    private LocalDateTime createTime;//创建时间
    private LocalDateTime updateTime;//更新时间
    private Integer department;//部门
    private String role;//角色
    private Integer college;//学院
}
